import java.util.Scanner;

public class FindMum {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入起始数：");
        int i = sc.nextInt();
        System.out.println("请输入末位数：");
        int p = sc.nextInt();
        findMunber(i, p );
    }

    public static void findMunber(int a, int b) {
        int j = 0;
        int i = 0;
        int count = 0;
        for ( i = a; i <= b; i++) {
            for ( j = 2; j <= i / 2 ; j++) {
                if(i % j == 0) {
                    break;
                }
            }
            if(j == (i / 2) + 1) {
                System.out.println(i);
                count++;
            }
        }
        System.out.println(count);
    }
}
